/**
 * @param {string} title
 * @param {HTMLDivElement} content 内容
 */
function popup(title: string, content: string) {
  const $container = document.createElement("div");
  $container.className = "popup-container"
  $container.innerHTML = `
  <div class="popup-container">
        <div class="popup-content">
            <div class="popup-titlebar">
                <h1>${title}</h1>
                <span class="popup-close">x</span>
            </div>
            ${content}
        </div>
    </div>
  `
  document.body.appendChild($container);
  $container.addEventListener("click", function () {
    this.remove();
  });
  (<HTMLDivElement>$container.querySelector(".popup-content")).addEventListener("click", function (event) {
    event.stopPropagation()
  });
  (<HTMLDivElement>$container.querySelector(".popup-close")).addEventListener("click", function () {
    $container.remove();
  });
}